home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 7 / FM Towns Free Software Collection 7.iso / taropyon / cci / ccilib.h < prev    next >
C/C++ Source or Header  |  1993-11-30  |  10KB  |  338 lines

  1. #ifndef    _CCILIB_H
  2. #define    _CCILIB_H
  3.  
  4. #ifndef    NULL
  5. #    define    NULL    0
  6. #endif
  7. #ifndef    NORMAL
  8. #    define    NORMAL    (0)
  9. #endif
  10. #ifndef    ERROR
  11. #    define    ERROR    (-1)
  12. #endif
  13. #ifndef    ERR
  14. #    define    ERR        ERROR
  15. #endif
  16. #ifndef    FALSE
  17. #    define    FALSE    (0)
  18. #endif
  19. #ifndef    TRUE
  20. #    define    TRUE    (1)
  21. #endif
  22.  
  23. /*************************************************************************
  24. *    C標準ライブラリ
  25. *************************************************************************/
  26. #ifndef    BUFSIZ
  27. #    define    BUFSIZ    (512)
  28. #endif
  29. #ifndef    EOF
  30. #    define    EOF        (-1)
  31. #endif
  32. #define    SEEK_SET    (0)
  33. #define    SEEK_CUR    (1)
  34. #define    SEEK_END    (2)
  35.  
  36. /*************************************************************************
  37. *    イベント処理用
  38. *************************************************************************/
  39.  
  40. #define    GET_EVTSBJ_PTR(sbj)    GetEvtSbjPtr(sbj)
  41.  
  42. #ifndef    EVT_CANCEL
  43. #define    EVT_CANCEL    (-1)
  44. #define    EVT_BREAK    (-2)
  45. #endif
  46.  
  47. #ifndef    EVTIGN_MOUSE
  48. #define    EVTIGN_MOUSE    (1)        /* マウスイベント禁止    */
  49. #define    EVTIGN_KEY        (2)        /* キーイベント禁止        */
  50. #endif
  51.  
  52. #ifndef    EVTYPE_KEY
  53. #define    EVTYPE_KEY        (1)
  54. #define    KEYEVT_ADR        (0)    /* キーアドレスが一致        */
  55. #define    KEYEVT_SHIFT    (1)    /* キーシフトも一致            */
  56. #endif
  57.  
  58. #ifndef    EVTYPE_MOUSE
  59. #define    EVTYPE_MOUSE    (2)
  60. #define    EVTYPE_MOS2        (3)    /* page 0 用マウスイベント    */
  61. #endif
  62.  
  63. #ifndef    BTN_LEFT
  64. #define    BTN_LEFT        (1)
  65. #define    BTN_RIGHT        (2)
  66. #define    MOSEVT_BTN        (0x01)    /* ボタンタイプ                    */
  67. #define    MOSEVT_NOT        (0x02)    /* ボタン反転タイプ                */
  68. #define    MOSEVT_NOACT    (0x03)    /* ボタン選択アクションなし        */
  69. #define    MOSEVT_AREA        (0x04)    /* 指定エリア                    */
  70. #define    MOSEVT_OUTAREA    (0x05)    /* 指定エリア外                    */
  71. #define    MOSEVT_BTNOLY    (0x06)    /* ボタンが押された場合            */
  72. #define    MOSEVT_MOVE        (0x07)    /* カーソルに移動があった場合    */
  73. #define    MOSEVT_OUTBTN    (0x08)    /* 範囲外でボタンON                */
  74.  
  75. #define    MOSEVT_REPEAT    (0x10)    /* リピートタイプ(ボタン)        */
  76. #define    MOSEVT_QUICK    (0x10)    /* クイックタイプ(リピートと同じ)    */
  77. #endif
  78.  
  79. /*************************************************************************
  80. *    マウス用
  81. *************************************************************************/
  82. #ifndef    MOS_CON
  83. #define    MOS_CON()    MOS_curDisp(1)
  84. #define    MOS_COFF()    MOS_curDisp(0)
  85. #define    MOS_DEC()    MOS_curDisp(2)
  86. #define    MOS_INC()    MOS_curDisp(3)
  87. #endif
  88.  
  89. /*************************************************************************
  90. *    ダイアログ用
  91. *************************************************************************/
  92. #ifndef    DLGPOS_MOS_SET_HOME
  93. #define    DLGPOS_MOS_SET_HOME        (0x10010)    /* マウス位置(左上)    */
  94. #define    DLGPOS_MOS_SET_CENTER    (0x10020)    /* マウス位置中央        */
  95. #define    DLGPOS_CENTER_OF_SCN    (0x10030)    /* 画面中央                */
  96. #endif
  97.  
  98. #ifndef    DLGMSG_POS_CONTINUE
  99. #define    DLGMSG_POS_CONTINUE        (-1)
  100. #define    DLGMSG_POS_CENTERING    (-2)
  101. #endif
  102.  
  103. /*************************************************************************
  104. *    メニュー処理用
  105. *************************************************************************/
  106.  
  107. #ifndef    MNU_BLK
  108. #define    MNU_BLK    (0)
  109. #define    MNU_MSG    (1)
  110. #define    MNU_NOR    (2)
  111. #define    MNU_DIG    (3)
  112. #define    MNU_STR    (4)
  113. #define    MNU_SEL    (5)
  114. #define    MNU_IGN    (0x80)    /* 実行禁止    */
  115.  
  116. #define    MNUATT_EXIT    (1)        /* EXIT ボタン付    */
  117. #define    MNUATT_LOOP    (2)        /* LOOP フラグ        */
  118. #endif
  119.  
  120. #ifndef    MENU_SURE_OK
  121. #define    MENU_SURE_OK        (1)
  122. #define    SELBTN_ATT_LEFT        (0)    /* 左詰め表示                */
  123. #define    SELBTN_ATT_CENTER    (1)    /* メッセージのセンタリング    */
  124. #endif
  125.  
  126. /*************************************************************************
  127. *    ファイルダイアログ
  128. *************************************************************************/
  129.  
  130. #define    FDL_MODE_SINGLE            (0x00000001)    /* ファイルをひとつだけ選択/指定        */
  131. #define    FDL_MODE_MULTI            (0x00000002)    /* 複数選択/指定                        */
  132. #define    FDL_MODE_PATH            (0x00000003)    /* ディレクトリ選択/指定                */
  133. #define    FDL_MODE_BIT_DIRIGN        (0x00000080)    /* サブディレクトリの選択/指定を禁止    */
  134. #define    FDL_MODE_BIT_DUPIGN        (0x00000800)    /* 同一ファイル1の選択を禁止する        */
  135. #define    FDL_MODE_BIT_EXIST        (0x00008000)    /* 存在するファイルのみ選択可能            */
  136. #define    FDL_MODE_BIT_SIDEWORK    (0x00010000)    /* サイドーク                            */
  137. #define    FDL_MODE_BIT_DOSCALL    (0x00020000)    /* DOS コマンド                            */
  138. #define    FDL_MODE_DEFAULT    (FDL_MODE_SINGLE|FDL_MODE_BIT_DIRIGN|FDL_MODE_BIT_SIDEWORK)
  139.  
  140. #define    FDL_SORT_OFF        (0)            /* ソートなし        */
  141. #define    FDL_SORT_FILE        (1)            /* ファイル名        */
  142. #define    FDL_SORT_SUB        (2)            /* 拡張子            */
  143. #define    FDL_SORT_DATE        (3)            /* 日付                */
  144. #define    FDL_SORT_SIZE        (4)            /* サイズ            */
  145. #define    FDL_SORT_RVS        (0x80)        /* 昇順/降順        */
  146. #define    FDL_SORT_DIRBIT        (0x60)
  147. #define    FDL_SORT_DIRTOP        (0x00)        /* ディレクトリ先頭    */
  148. #define    FDL_SORT_DIRLAST    (0x20)        /* ディレクトリ最後    */
  149. #define    FDL_SORT_DIROFF        (0x40)        /* ディレクトリ        */
  150.  
  151. #define    FDL_ISSORT_DIRTOP(_sort)    (((_sort)&FDL_SORT_DIRBIT) == FDL_SORT_DIRTOP)
  152. #define    FDL_ISSORT_DIRLAST(_sort)    (((_sort)&FDL_SORT_DIRBIT) == FDL_SORT_DIRLAST)
  153. #define    FDL_ISSORT_DIROFF(_sort)    (((_sort)&FDL_SORT_DIRBIT) == FDL_SORT_DIROFF)
  154.  
  155. /*************************************************************************
  156. *    表示/カラー
  157. *************************************************************************/
  158.  
  159. #ifndef    C_BLACK
  160. #define    C_BLACK        0
  161. #define    C_BLUE        1
  162. #define    C_RED        2
  163. #define    C_MAGENTA    3
  164. #define    C_GREEN        4
  165. #define    C_CYAN        5
  166. #define    C_YELLOW    6
  167. #define    C_WHITE        7
  168. #define    C_HBLACK    8
  169. #define    C_HBLUE        9
  170. #define    C_HRED        10
  171. #define    C_HMAGENTA    11
  172. #define    C_HGREEN    12
  173. #define    C_HCYAN        13
  174. #define    C_HYELLOW    14
  175. #define    C_HWHITE    15
  176.  
  177. #define    C_THROUGH    0
  178. #define    C_MBLACK    1
  179. #endif
  180.  
  181. #define    C_GRAY        C_WHITE
  182. #define    C_DARK        C_HBLACK
  183. #define    C_WARNNING    C_HYELLOW
  184. #define    C_ERROR        C_HRED
  185. #define    C_INFO        C_HGREEN
  186. #define    C_TIMEBOX    C_CYAN
  187. #define    C_GRAY0        C_HBLACK
  188. #define    C_GRAY1        C_RED
  189. #define    C_GRAY2        C_WHITE
  190. #define    C_GRAY3        C_MAGENTA
  191. #define    C_METAL0    C_GREEN
  192. #define    C_METAL1    C_CYAN
  193. #define    C_METAL2    C_YELLOW
  194. #define    C_DLGBASE    C_MAGENTA
  195.  
  196. #ifndef    PSET
  197. #define    PSET    0
  198. #define    PRESET    1
  199. #define    OR        2
  200. #define    AND        3
  201. #define    XOR        4
  202. #define    NOT        5
  203. #define    OPAQUE    9
  204. #endif
  205.  
  206. #ifndef    MASKSET
  207. #define    MASKSET        13
  208. #define    MASKRESET    14
  209. #define    MASTNOT        15
  210. #endif
  211.  
  212. #ifndef    COLMIX
  213. #define    COLMIX(c1,c2)    (0x1000|(((c1)&15)<<4)|((c2)&15))
  214. #endif
  215.  
  216. /*************************************************************************
  217. *    IMG
  218. *************************************************************************/
  219.  
  220. #define    IMG_ATT_PLTON    (0x00010000)
  221.  
  222. /*************************************************************************
  223. *    ファイル複写
  224. *************************************************************************/
  225.  
  226. #define    FCOPY_OVERWRITE_CHECK    (0x01)    /* 上書き確認する            */
  227. #define    FCOPY_TIME_CHECK        (0x02)    /* 日付比較                    */
  228. #define    FCOPY_SINGLE_COPY        (0x04)    /* ファイルひとつだけ複写    */
  229. #define    FCOPY_LAST_MSG_IGN        (0x80)    /* 最後のメッセージ表示禁止    */
  230.  
  231.  
  232. /*************************************************************************
  233. *    キーコード/アドレス
  234. *************************************************************************/
  235.  
  236. #define    KA_BIT_SHIFT    (0x04)
  237. #define    KA_BIT_CTRL        (0x10)
  238.  
  239. #define    KC_CAN        0x03    /* キャンセル [CTRL+C]    */
  240. #define    KC_CR        0x0D    /* RETURN    */
  241. #define    KC_LF        0x0A    /* LF        */
  242. #define    KC_BS        0x08    /* バック スペース    */
  243. #define    KC_TAB        0x09    /* TAB        */
  244. #define    KC_ESC        0x1B    /* ESC    */
  245.  
  246. #define    KA_ESC        0x0100    /* [ESC]        */
  247. #define    KA_1        0x0200
  248. #define    KA_2        0x0300
  249. #define    KA_3        0x0400
  250. #define    KA_4        0x0500
  251. #define    KA_5        0x0600
  252. #define    KA_6        0x0700
  253. #define    KA_7        0x0800
  254. #define    KA_8        0x0900
  255. #define    KA_9        0x0A00
  256. #define    KA_0        0x0B00
  257. #define KA_BS        0x0F00    /* [BS]            */
  258. #define KA_TAB        0x1000    /* [TAB]            */
  259.  
  260. #define    KA_Q        0x1100
  261. #define    KA_W        0x1200
  262. #define    KA_E        0x1300
  263. #define    KA_R        0x1400
  264. #define    KA_T        0x1500
  265. #define    KA_Y        0x1600
  266. #define    KA_U        0x1700
  267. #define    KA_I        0x1800
  268. #define    KA_O        0x1900
  269. #define    KA_P        0x1A00
  270.  
  271. #define    KA_A        0x1E00
  272. #define    KA_S        0x1F00
  273. #define    KA_D        0x2000
  274. #define    KA_F        0x2100
  275. #define    KA_G        0x2200
  276. #define    KA_H        0x2300
  277. #define    KA_J        0x2400
  278. #define    KA_K        0x2500
  279. #define    KA_L        0x2600
  280. #define    KA_SEMICOLON 0x2700    /* ; */
  281.  
  282. #define    KA_Z        0x2A00
  283. #define    KA_X        0x2B00
  284. #define    KA_C        0x2C00
  285. #define    KA_V        0x2D00
  286. #define    KA_B        0x2E00
  287. #define    KA_N        0x2F00
  288. #define    KA_M        0x3000
  289.  
  290. #define    KA_SPACE    0x3500
  291. #define    KA_RETURN    0x1D00    /* [RETURN]        */
  292. #define    KA_DEL        0x4B00    /* Del            */
  293. #define    KA_INS        0x4800    /* 挿入            */
  294. #define    KA_LEFT        0x4F00    /* Left  [←]    */
  295. #define    KA_RIGHT    0x5100    /* Right [→]    */
  296. #define    KA_UP        0x4D00    /* Up    [↑]    */
  297. #define    KA_DOWN        0x5000    /* Down  [↓]    */
  298. #define    KA_HOME        0x4E00    /* [HOME]        */
  299. #define    KA_PREV        0x6E00    /* [前行]        */
  300. #define    KA_NEXT        0x7000    /* [次行]        */
  301. #define    KA_BEFORE    0x6E00    /* [前行](old)    */
  302.  
  303. #define    KA_OASLEFT    0x6700    /* [シフト左] 親指シフトキーボード    */
  304. #define    KA_OASRIGHT    0x6800    /* [シフト右] 親指シフトキーボード    */
  305.  
  306. #define    KA_KANDIC    0x6B00    /* [漢字辞書]    */
  307. #define    KA_KANDEL    0x6C00    /* [単語抹消]    */
  308. #define    KA_KANSET    0x6D00    /* [単語登録]    */
  309. #define    KA_KANHZ    0x7100    /* [半角全角]    */
  310.  
  311. #define    KA_CANCEL    0x7200    /* [取消]    */
  312. #define    KA_EXEC        0x7300    /* [実行]    */
  313. #define    KA_BREAK    0x7C00    /* [BREAK]    */
  314. #define    KA_COPY        0x7D00    /* [COPY]    */
  315.  
  316. #define    KA_PF1        0x5D00    /* [PF-1]    */
  317. #define    KA_PF2        0x5E00    /* [PF-2]    */
  318. #define    KA_PF3        0x5F00    /* [PF-3]    */
  319. #define    KA_PF4        0x6000    /* [PF-4]    */
  320. #define    KA_PF5        0x6100    /* [PF-5]    */
  321. #define    KA_PF6        0x6200    /* [PF-6]    */
  322. #define    KA_PF7        0x6300    /* [PF-7]    */
  323. #define    KA_PF8        0x6400    /* [PF-8]    */
  324. #define    KA_PF9        0x6500    /* [PF-9]    */
  325. #define    KA_PF10        0x6600    /* [PF10]    */
  326. #define    KA_PF11        0x6900    /* [PF11]    */
  327. #define    KA_PF12        0x5B00    /* [PF12]    */
  328. #define    KA_PF13        0x7400
  329. #define    KA_PF14        0x7500
  330. #define    KA_PF15        0x7600
  331. #define    KA_PF16        0x7700
  332. #define    KA_PF17        0x7800
  333. #define    KA_PF18        0x7900
  334. #define    KA_PF19        0x7A00
  335. #define    KA_PF20        0x7B00
  336.  
  337. #endif
  338.